//
// Created by Yun on 2025/2/25.
//

#include "user_register_event.h"

static void TimeSliceOS_Start(void* pArgs)
{
    (void)pArgs;
    TimeSliceOS_Run(&stTSOSController);
}

void User_Register_Event(void)
{
    /* 系统周期事件 */
     Event_Register(NULL,
                    EVENT_SYS_CIRCLE,
                    15,
                    Dev_Button_Monitor);

    /* 按键事件 */
    Event_Register(&stDev_Button1,
                   EVENT_DEV_KEY_PRESSED,
                   1,
                   App_Button_Demo);

    Event_Register(&stDev_Button2,
                   EVENT_DEV_KEY_PRESSED,
                   1,
                   App_Button2_Demo);

    Event_Register(&stDev_Button3,
                   EVENT_DEV_KEY_PRESSED,
                   1,
                   App_Button3_Demo);

    /* LED点亮事件 */
    Event_Register(&stDev_Blue_Led,
                   EVENT_DEV_LED_ON,
                   1,
                   App_Led_Demo);

    Event_Register(&stDev_Blue_Led,
                   EVENT_DEV_LED_OFF,
                   1,
                   App_Led2_Demo);

    /* 接收完成事件 */
    Event_Register(&stDev_Uart1,
                   EVENT_DEV_UART_RX,
                   3,
                   App_Uart_Rx_Demo);
    Event_Register(&stDev_Uart1,
                   EVENT_DEV_UART_TX,
                   1,
                   App_Uart_Tx_Demo);

    /* 定时器超时事件--时间片标志 */
    Event_Register(&stDev_Tim6,
                   EVENT_DEV_TIM_TIMOUT,
                   15,
                   TimeSliceOS_Start);
    //Event_Register(&stDev_Tim6_5,EVENT_DEV_TIM_TIMOUT, 1, App_Tim_Demo);
}

